package com.shenzhen.horselive.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.shenzhen.horselive.R;
import com.shenzhen.horselive.beans.ApplyHistory;

import org.jetbrains.annotations.NotNull;

public class OpenHistoryAdapter extends BaseQuickAdapter<ApplyHistory.DataBean, BaseViewHolder> {
    public OpenHistoryAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, ApplyHistory.DataBean s) {
        baseViewHolder.setText(R.id.tv_time,s.getCreateTime())
                .setText(R.id.tv_text,s.getSchemeName())
                .setText(R.id.tv_author,s.getOpenName()+"/"+s.getOpenPhone())
                .setText(R.id.tv_city,s.getOpenCity()+s.getOpenArea());
        // 1=>’预约中’,2=>’已失效’,0=>’待提交’,3=>’待邮寄’,4=>’已邮寄’ ,5=>’’权限未开通‘,6=>’’已取消’
        switch (s.getOrderStatus())
        {
            case 0:
                baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_jiao_wait_tijiao);
                 break;
            case 1:
                baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_send_ing);
                break;
            case 2:
                baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_jiao_shixiao);
                break;
            case 3:
                baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_wait_send);
                break;
            case 4:
                baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_send_ed);
                break;
            case 5:
                baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_quanxian_daikaitong);
                break;
            case 6:
                baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_cancel);
                break;
        }
    }
}
